<?php
/**
 * crpTag
 *
 * @copyright (c) 2007, Daniele Conca
 * @link http://code.zikula.org/crptag Support and documentation
 * @author Daniele Conca <conca.daniele@gmail.com>
 * @license GNU/GPL - v.2.1
 * @package crpTag
 */

/**
 * crpTag Object
 */
class crpTagUI
{

	function crpTagUI()
	{

	}

	function newItemtags($tagmodvars = array ())
	{
		// Create output object
		$pnRender = pnRender :: getInstance('crpTag', false);

		$pnRender->assign($tagmodvars);

		// Return the output that has been generated by this function
		return $pnRender->fetch('hooks/crptag_admin_newtag.htm');
	}

	function modifyItemTags($tagString = null, $tagmodvars = array ())
	{
		// Create output object
		$pnRender = pnRender :: getInstance('crpTag', false);

		$pnRender->assign($tagmodvars);
		$pnRender->assign('tagString', $tagString);

		// Return the output that has been generated by this function
		return $pnRender->fetch('hooks/crptag_admin_modifytag.htm');
	}

	function displayItemTags($tagArray = array (), $tagmodvars = array ())
	{
		// Create output object
		$pnRender = pnRender :: getInstance('crpTag', false);

		$pnRender->assign($tagmodvars);
		$pnRender->assign('tagArray', $tagArray);

		// Return the output that has been generated by this function
		return $pnRender->fetch('crptag_user_embedtag.htm');
	}
	
	function displayTaggedItems($tagArray = array (), $tagmodvars = array (), $pager=array(), $id_tag=null, $tagmodule=null)
	{
		// Create output object
		$pnRender = pnRender :: getInstance('crpTag', false);

		$pnRender->assign($tagmodvars);
		$pnRender->assign('tagArray', $tagArray);
		$pnRender->assign('pager', $pager);
		$pnRender->assign('id_tag', $id_tag);
		$pnRender->assign('tagmodule', $tagmodule);
		
		// Return the output that has been generated by this function
		return $pnRender->fetch('crptag_user_viewtag.htm');
	}
	
	function displayMain($tagArray = array (), $tagmodvars = array (), $pager=array())
	{
		// Create output object
		$pnRender = pnRender :: getInstance('crpTag', false);

		$pnRender->assign($tagmodvars);
		$pnRender->assign('tagArray', $tagArray);
		$pnRender->assign('pager', $pager);
		
		// Return the output that has been generated by this function
		return $pnRender->fetch('crptag_user_maintag.htm');
	}
	
	/**
	 * Draw modify configuration form
	 * 
	 * @return string html
	 */
	function modifyConfig($modvars=array())
	{
		// Create output object
    $pnRender = pnRender::getInstance('crpTag', false);

    $pnRender->assign($modvars);

    // Return the output that has been generated by this function
    return $pnRender->fetch('crptag_admin_modifyconfig.htm');
	}
}